package org.example;

import java.util.Comparator;
import java.util.Iterator;
import java.util.PriorityQueue;
import java.util.Queue;

public class PriorityQueueTest1 {
    public static void main(String[] args) {
        int[] arr = {1,3,5,7,2,4,2,6,85,5,2,4};
        Queue<Integer> pq1 = new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2.compareTo(o1);
            }
        });
        pq1.offer(10);
        pq1.offer(101);
        pq1.offer(20);
        pq1.offer(8);
        pq1.offer(22);
        pq1.offer(12);
        System.out.println(pq1.peek());

        pq1.poll();
        System.out.println(pq1.peek());

    }
}
